package cloud.simple.controller;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import cloud.simple.service.TestService;

 

@RestController
//@RefreshScope
public class TestController {
 	@Autowired
	TestService testService;
	@RequestMapping(value = "/test", method = RequestMethod.GET)
	public List<Map<String, Object>> readUserInfo() {
		return testService.getAll();
	}
	@Value("${spring.cloud.config.profile}")
	private String profile;

	@GetMapping("/hello")
	public String hello() {
		return this.profile;
	}

}